//
// Created by user on 2022/1/13.
//
#include <iostream>
#include <vector>

using namespace  std;

vector<string> commonChars(vector<string>& words) {
    vector<int> minfre(26);
    for (char c: words[0]){
        minfre[c-'a']++;
    }

    vector<int> freq(26);
    for (int i = 1; i < words.size(); ++i) {
        fill(freq.begin(), freq.end(), 0);
        for (char c: words[i]){
            freq[c-'a']++;
        }
        for (int j = 0; j < 26; ++j) {
            minfre[j] = fmin(minfre[j], freq[j]);
        }
    }
    vector<string> ans;
    for (int i = 0; i < 26; ++i) {
        for (int j = 0; j < minfre[i]; ++j) {
            ans.emplace_back(1, i+'a');
        }
    }
    return ans;
}

int main(){


    return 0;
}